﻿using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Volo.Abp.AspNetCore.Mvc.Conventions;
using Volo.Abp.DependencyInjection;

namespace youzackcom.ConventionalRouteBuilder
{
    /// <summary>
    /// 自定义路由生成器 
    /// </summary>
    [Dependency(ReplaceServices = true)] //替换默认的路由生成器
    public class CustomerConventionalRouteBuilder : IConventionalRouteBuilder, ITransientDependency  //常规路由生成器
    {
        public string Build(string rootPath, string controllerName, ActionModel action, string httpMethod, ConventionalControllerSetting? configuration)
        {
            if (controllerName == "Order")
            {

            }
            return $"youzackcom/{rootPath}/{controllerName}/{action.ActionName}".ToLower();
        }
    }
}
